import 'package:yurun_smartmerchants/models/tallied_response_entity_entity.dart';

talliedResponseEntityEntityFromJson(TalliedResponseEntityEntity data, Map<String, dynamic> json) {
	if (json['total'] != null) {
		data.total = json['total']?.toInt();
	}
	if (json['totalPage'] != null) {
		data.totalPage = json['totalPage']?.toInt();
	}
	if (json['content'] != null) {
		data.content = new List<TalliedResponseEntityContent>();
		(json['content'] as List).forEach((v) {
			data.content.add(new TalliedResponseEntityContent().fromJson(v));
		});
	}
	return data;
}

Map<String, dynamic> talliedResponseEntityEntityToJson(TalliedResponseEntityEntity entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['total'] = entity.total;
	data['totalPage'] = entity.totalPage;
	if (entity.content != null) {
		data['content'] =  entity.content.map((v) => v.toJson()).toList();
	}
	return data;
}

talliedResponseEntityContentFromJson(TalliedResponseEntityContent data, Map<String, dynamic> json) {
	if (json['modifiedTime'] != null) {
		data.modifiedTime = json['modifiedTime']?.toInt();
	}
	if (json['surplus'] != null) {
		data.surplus = json['surplus']?.toDouble();
	}
	if (json['postWeight'] != null) {
		data.postWeight = json['postWeight']?.toDouble();
	}
	if (json['batch'] != null) {
		data.batch = json['batch']?.toString();
	}
	if (json['name'] != null) {
		data.name = json['name']?.toString();
	}
	if (json['id'] != null) {
		data.id = json['id']?.toInt();
	}
	if (json['url'] != null) {
		data.url = json['url']?.toString();
	}
	return data;
}

Map<String, dynamic> talliedResponseEntityContentToJson(TalliedResponseEntityContent entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['modifiedTime'] = entity.modifiedTime;
	data['surplus'] = entity.surplus;
	data['postWeight'] = entity.postWeight;
	data['batch'] = entity.batch;
	data['name'] = entity.name;
	data['id'] = entity.id;
	data['url'] = entity.url;
	return data;
}